package io.gitee.zhangbinhub.admin.oauth.repo

import io.gitee.zhangbinhub.admin.oauth.base.BaseRepository
import io.gitee.zhangbinhub.admin.oauth.entity.Organization
import org.springframework.data.repository.query.Param

/**
 * @author zhangbin by 2018-1-17 17:45
 * @since JDK 11
 */
interface OrganizationRepository : BaseRepository<Organization, String> {

    fun findAllByOrderBySortAsc(): MutableList<Organization>

    fun findByParentIdIn(idList: MutableList<String>): MutableList<Organization>

    fun findAllByCodeLikeOrNameLikeOrderBySortAsc(
        @Param(value = "code") code: String,
        @Param(value = "name") name: String
    ): MutableList<Organization>

    fun deleteByIdIn(idList: MutableList<String>)

}
